It may be useful for electronic devices to store data in a non-volatile memory such that the data remains intact when power to the electronic device is turned off or otherwise lost. The non-volatile memory device for storing digital information in an array of non-volatile memory cells may be included in a Non-Volatile Dual In-line Memory Module (NVDIMM). Digital information stored in the non-volatile memory (for example, NAND/NOR flash memory) persists in the memory during power loss or system failures. After power to the electronic device is restored, the electronic device can access the stored digital data from the NVDIMM.
Logic executing in an electronic device can modify data stored in non-volatile memory. For example, logic executing on a processor of the electronic device may update a data element stored in non-volatile memory. In such an instance, the logic retrieves a copy of the data element stored in non-volatile memory and stores a copy of the data element in a volatile memory, e.g., cache memory.
The logic may update the data while the data element is stored in volatile memory. Subsequent to completing any changes to the copy of the data element stored in volatile memory, the logic may return the updated data element to non-volatile memory.
If a failure such as loss of power occurs prior to complete storage of a modified data element into non-volatile memory, it is possible that none or only a portion of the data element will be written to non-volatile memory. In such an instance, the power failure results in loss of data because the modified data element is not properly stored in non-volatile memory.